package com.asset.salesforce.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Table(name="invoice_item")
@Entity
@PrimaryKeyJoinColumn(name="id")
public class InvoiceItem implements Serializable {
	
	private Integer id;
	private Invoice invoice;
	private InvoiceItemParent invoiceItemParent;	
	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="invoice_item_id_seq")
	@SequenceGenerator(name="invoice_item_id_seq",sequenceName="invoice_item_id_seq",allocationSize=1)
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the invoice
	 */
	@ManyToOne
	@JoinColumn(name="invoice_id")
	public Invoice getInvoice() {
		return invoice;
	}

	/**
	 * @param invoice the invoice to set
	 */
	public void setInvoice(Invoice invoice) {
		this.invoice = invoice;
	}

	/**
	 * @return the invoiceItemParent
	 */
	@ManyToOne
	@JoinColumn(name="item_id")
	public InvoiceItemParent getInvoiceItemParent() {
		return invoiceItemParent;
	}

	/**
	 * @param invoiceItemParent the invoiceItemParent to set
	 */
	public void setInvoiceItemParent(InvoiceItemParent invoiceItemParent) {
		this.invoiceItemParent = invoiceItemParent;
	}
	
	
}
